<template>
	<view class="flex_box">
		<u-navbar :border-bottom="false" title="我的收藏" back-icon-color="#ffffff" :background="{background:'#2149c3'}" title-color="#ffffff"></u-navbar>
		<view class="news_list">
			<view class="u-body-item u-flex u-border-bottom u-col-between u-p-t-0" v-for="item in siteList" @click="godatil(item)">
				<view class="u-body-item-title">
					<view class="u-line-2">{{item.title}}</view>
					<view class="ms_list">
						<view>{{item.createTime}}</view>
					</view>
				</view>
				<image src="https://img11.360buyimg.com/n7/jfs/t1/94448/29/2734/524808/5dd4cc16E990dfb6b/59c256f85a8c3757.jpg"
				 mode="aspectFill"></image>
			</view>
		</view>
	</view>
</template>

<script>
var _self;
import {
		mapState,
		mapMutations
} from 'vuex';
export default {
	data() {
		return {
			userInfoId:'',
			siteList: [{
			  createBy: null,
			  createTime: "2021-11-20 23:46:16",
			  id: 1,
			  memberId: 536,
			  newsId: 5,
			  params: {},
			  remark: null,
			  searchValue: null,
			  title: "木地板新的铺法,打造不一样的视觉效果",
			  updateBy: null,
			  updateTime: null,
			}],
			page: {pagenum: 1,pagesize: 10}
		};
	},
	onShow(){
		this.selectAddress();
	},
	onLoad() {
		this.selectAddress();
	},
	computed: {
		...mapState(['userInfo', 'hasLogin', 'scene', 'openid'])
	},
	methods: {
		selectAddress: function() {
			uni.request({
				url: this.serverUrl + 'app/getCollectList',
				header: {
					"content-type": "application/x-www-form-urlencoded; charset=UTF-8"
				},
				method: 'POST',
				data: {
					memberId :this.userInfo.id,
					pageSize: this.page.pagesize,
					pageNum: this.page.pagenum
				},
				success: (r) => {
					console.log(r.data.data,'getAddressList');
					if (r.data.code == 0) {
						this.siteList = r.data.data
						// this.newsList = r.data.data
					}
				}
			})
		},
		godatil:function(item){
			uni.navigateTo({
			    url: '/newpage/newdetail?id='+item.newsId
			});
		}
	}
};
</script>

<style lang="scss" scoped>
.news_list {
		padding: 20rpx 0rpx;
	}

	.news_list .u-body-item {
		display: flex;
		font-size: 30rpx;
		color: #333;
		padding: 20rpx 20rpx;
		align-items: center;
		padding-top: 40rpx;
		margin-bottom: 20rpx;
	}
	.u-body-item-title{
		flex: 1;
	}

	.news_list .u-body-item image {
		width: 160rpx;
		flex: 0 0 160rpx;
		height: 120rpx;
		border-radius: 10rpx;
		margin-left: 12rpx;
	}

	.news_list .u-line-2 {
		font-size: 30rpx;
		font-weight: normal;
		color: #333333;
		line-height: 34rpx;
	}

	.ms_list {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		margin-top: 15rpx;
		font-size: 23rpx;
		font-weight: normal;
		color: #a2a5ac;
	}
</style>
